<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <title>自动组卷</title>

    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">

    <link href="${ctx}/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
    <link href="${ctx}/css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
    <link href="${ctx}/css/style.min862f.css?v=4.1.0" rel="stylesheet">
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-md-12">
            <div class="ibox float-e-margins">

                <div class="ibox-content">
				<span>
					<h4><p class="text-danger"><i class="glyphicon glyphicon-info-sign"> </i>提示：如试题数量不足则不能完成自动组卷！</p></h4>
				</span>
                    <div class="col-md-6 alert alert-danger" role="alert">
                        <p>1.自动组卷将生成试卷A卷20套B卷20套</p>
                        <p>2.自动组卷将自动删除试卷题库所有试卷</p>
                        <p>3.要使用自动组卷必须满足自动组卷要求</p>
                    </div>
                    <div class="col-md-6">
                        <br/><br/>
                        <a id="start" class="btn-lg btn-primary">开始组卷</a>
                    </div>
                    <table class="table table-bordered">
                        <thead>
                        <tr>
                            <td class="col-md-2">试题类型</td>
                            <td class="col-md-2">当前数量</td>
                            <td class="col-md-2">最少数量</td>
                            <td class="col-md-2">试题类型</td>
                            <td class="col-md-2">当前数量</td>
                            <td class="col-md-2">最少数量</td>
                        </tr>
                        </thead>
                        <tbody>
                        <tr>
                            <td class="col-md-2">问答题-腧穴</td>
                            <td class="col-md-2">${count.XWCount}</td>
                            <td class="col-md-2">40</td>

                            <td class="col-md-2">问答题-内科</td>
                            <td class="col-md-2">${count.NKAMCount}</td>
                            <td class="col-md-2">40</td>
                        </tr>
                        <tr>
                            <td class="col-md-2">问答题-妇科</td>
                            <td class="col-md-2">${count.FKAMCount}</td>
                            <td class="col-md-2">40</td>

                            <td class="col-md-2">问答题-儿科</td>
                            <td class="col-md-2">${count.EKTNCount}</td>
                            <td class="col-md-2">40</td>
                        </tr>
                        <tr>
                            <td class="col-md-2">问答题-伤科</td>
                            <td class="col-md-2">${count.SKAMCount}</td>
                            <td class="col-md-2">40</td>

                            <td class="col-md-2">成人穴位</td>
                            <td class="col-md-2">${count.CRXWCount}</td>
                            <td class="col-md-2">40</td>
                        </tr>
                        <tr>
                            <td class="col-md-2">儿科穴位</td>
                            <td class="col-md-2">${count.EKXWCount}</td>
                            <td class="col-md-2">40</td>

                            <td class="col-md-2">成人手法</td>
                            <td class="col-md-2">${count.CRSFCount}</td>
                            <td class="col-md-2">40</td>
                        </tr>
                        <tr>
                            <td class="col-md-2">儿科手法</td>
                            <td class="col-md-2">${count.EKSFCount}</td>
                            <td class="col-md-2">40</td>

                            <td class="col-md-2">成套手法-伤科</td>
                            <td class="col-md-2">${count.SKZTCount}</td>
                            <td class="col-md-2">40</td>
                        </tr>
                        <tr>
                            <td class="col-md-2">成套手法-妇科</td>
                            <td class="col-md-2">${count.FKZTCount}</td>
                            <td class="col-md-2">40</td>

                            <td class="col-md-2">成套手法-儿科</td>
                            <td class="col-md-2">${count.EKZTCount}</td>
                            <td class="col-md-2">40</td>
                        </tr>
                        <tr>
                            <td class="col-md-2">问答题-触诊</td>
                            <td class="col-md-2">${count.CZCount}</td>
                            <td class="col-md-2">40</td>

                            <td class="col-md-2">单项手法-触诊诊断</td>
                            <td class="col-md-2">${count.CZZDCount}</td>
                            <td class="col-md-2">40</td>
                        </tr>
                        <tr>
                            <td class="col-md-2">成套手法-内科</td>
                            <td class="col-md-2">${count.NKZTCount}</td>
                            <td class="col-md-2">40</td>
                            <td class="col-md-2">成人穴位-客观化</td>
                            <td class="col-md-2">${count.KGHCount}</td>
                            <td class="col-md-2">40</td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
<script src="${ctx}/js/jquery.min.js?v=2.1.4"></script>
<script src="${ctx}/js/bootstrap.min.js?v=3.3.6"></script>
<script src="${ctx}/js/plugins/layer/layer.js"></script>
<script>
    $(function () {
        $("#start").click(function () {
            layer.confirm('确定要自动组卷吗？', {offset: '100px'}, function (index) {
                $.ajax({
                    url: "${ctx}/automatic/generate",
                    type: "post",
                    dataType: "json",
                    beforeSend: function () {
                        layer.closeAll('dialog');
                        layer.msg('正在组卷', {
                            time:120*1000, //最长加载两分钟
                            icon: 16,
                            shade: 0.01
                        });
                    },
                    complete: function () {
                        layer.closeAll('loading');
                    },
                    success: function (data) {

                        var status = data.status;
                        if (status == "401") {
                            layer.alert('您没有权限', {
                                icon: 4,
                                skin: 'layer-ext-moon'
                            })
                        } else if (status == "2001") {
                            layer.alert('试题数量不足!', {
                                icon: 3,
                                skin: 'layer-ext-moon'
                            })
                        } else if (status == "1001") {
                            layer.alert('组卷成功!', {
                                icon: 1,
                                skin: 'layer-ext-moon'
                            })
                        } else {
                            layer.alert('组卷失败!', {
                                icon: 5,
                                skin: 'layer-ext-moon'
                            })
                        }

                    }


                });
            });
        })

    });
</script>

</html>
